﻿<!--

                        function ViewChanged(selectedCub)
                        { 
   	                            //var selectedCub= document.form.DCubeView.options[document.form.DCubeView.selectedIndex].value;
                            DCube.DataPath = selectedCub; 

                            document.form.DCubeProperty.selectedIndex = 0
  	                            document.form.Color.selectedIndex = 0
  	                            document.form.DCubeStyle.selectedIndex = 0
                        }

                        function window_onLoad()
                        {
                            var elem=document.getElementById("DCube");
                            var cubfile=document.getElementById("ctl00_ContentPlaceHolder3_HidCubName").value;
                            elem.DataPath = cubfile;
                        }

                        function ExportToExcel()
                        {
                            var elem=document.getElementById("DCube");
                            var elemDialog=document.getElementById("dialog");
                            
                            var fileName = ""
                            var includeTotals = true;
                            var formatNumbers = true;
                            var includeColors = true;
                            var merge = true;
                        	
                             elemDialog.Filter = "Excel Document|*.xls";
                            elemDialog.filename="";
                             //elemDialog.ShowSave();
                             fileName =elemDialog.filename;
                        	
                            //if (fileName != "")
                            //{ 
                            var ret=confirm("Do you want to  save as Excel?");
                            if(ret)
                            {
                                 elem.ExportToExcel("test.xls", includeTotals,formatNumbers, includeColors, merge);
                                window.alert("Exported to " + "test.xls" + "." );
                             }
                            //}
                        }

                        function ExportToHTML()
                        {
                            var elem=document.getElementById("DCube");
                            var elemDialog=document.getElementById("dialog");
                            var fileName = "C:\\\DC3HTMLExport.html"
                            var includeTotals = true;
                            var formatNumbers = true;
                            var includeColors = true;
                            var merge = true;
                        	
                            elemDialog.Filter = "HTML Document|*.html"
                            elemDialog.filename=""
                            //elemDialog.ShowSave();
                             fileName =elemDialog.filename;
                        	
                            //if (fileName != "")
                            //{
                            var ret=confirm("Do you want to save as HTML?");
                            if(ret)
                            {
                                 elem.ExportToHTML("test.html", includeTotals,formatNumbers, includeColors, merge);
                                 window.alert("Exported to " + "test.html" + "." );
                            }
                            //}
                        }

                        function PrintPreview()
                        {
                            var elem=document.getElementById("DCube");
	                            elem.IncludeColorsInPrintout = true;
                            elem.ColHeadingsOnEveryPage = true;
                            elem.RowHeadingsOnEveryPage = true;
                            elem.PrintRowFieldNames = true;
                            elem.PrintColFieldNames = true;
                            elem.PrintPreview();
                        }

                        function PropertyChange()
                        {
                            var PropName = document.form.DCubeProperty.options[document.form.DCubeProperty.selectedIndex].value;
                            var PropColor =  document.form.Color.options[document.form.Color.selectedIndex].value;
                        	
                            if (PropColor != "")
                            {
                                 switch (PropName )
                                 {
                                 case "HeadingsForeColor": 
                        		
	                            DCube.HeadingsForeColor= PropColor;
	                            break;
                        		
                                 case "HeadingsBackColor": 
	                            DCube.HeadingsBackColor= PropColor;
	                            break;
                        		
                                 case "FieldsForeColor": 
	                            DCube.FieldsForeColor= PropColor;
	                            break;
                                 case "FieldsBackColor": 
	                            DCube.FieldsBackColor= PropColor;
	                            break;
                                 case "FilteredFieldForeColor": 
	                            DCube.FilteredFieldForeColor=PropColor;
	                            break;
                                 case "FilteredFieldBackColor": 
	                            DCube.FilteredFieldBackColor= PropColor;
	                            break;
                                 case "TotalsForeColor": 
	                            DCube.TotalsForeColor= PropColor;
	                            break;
                                 case "TotalsBackColor": 
	                            DCube.TotalsBackColor= PropColor;
	                            break;
                                 case "CubeBackColor": 
	                            DCube.CubeBackColor= PropColor;
	                            break;
                                 case "BackColor": 
	                            DCube.BackColor= PropColor;
	                            break;
                                 case "ForeColor": 
	                            DCube.ForeColor= PropColor;
	                            break;
                                 case "HeaderForeColor": 
	                            DCube.HeaderForeColor=PropColor;
	                            break;
                                 case "HeaderBackColor": 
	                            DCube.HeaderBackColor=PropColor;
	                            break;
                                 case "FooterForeColor": 
	                            DCube.FooterForeColor= PropColor;
	                            break;
                                 case "FooterBackColor": 
	                            DCube.FooterBackColor= PropColor;
	                            break;	
     	                            }
                            }
                            DCube.Refresh();
                        }

                        function StyleChanged()
                        {
                            var dcStyle = document.form.DCubeStyle.options[document.form.DCubeStyle.selectedIndex].value;
	                            DCube.RowStyle = dcStyle;
	                            DCube.ColStyle = dcStyle;
                            DCube.Refresh();
                        	
                            document.form.DCubeProperty.selectedIndex = 0
                            document.form.Color.selectedIndex = 0
                        }
                        -->